﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class administration_Admin : System.Web.UI.MasterPage
{
    public string AdminName
    {
        get
        {
            return (Session["AdminName"] ?? "").ToString();
        }
    }
    public string AdminRoot
    {
        get
        {
            var Root = "http://" + Request.Url.Host + ":" + Request.Url.Port + "/" + Request.ApplicationPath;
            Root += Root.EndsWith("/") ? "" : "/";
            Root += "administration/";
            return Root;
        }
    }
    public string Root
    {
        get
        {
            var Root = "http://" + Request.Url.Host + ":" + Request.Url.Port + "/" + Request.ApplicationPath;
            Root += Root.EndsWith("/") ? "" : "/";
            return Root;
        }
    }

    protected void Page_Init(object sender, EventArgs e)
    {
        if (Session["AdminName"] == null || String.IsNullOrWhiteSpace(Session["AdminName"].ToString()))
        {
            Response.Redirect("~/administration/login.aspx");
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            lblAdminName.Text = AdminName;
        }
    }
}
